home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Otherware
/
Otherware_1_SB_Development.iso
/
mac
/
hypercar
/
organiza
/
referfra.sit
/
Reference Frame
/
card_3557.txt
< prev
next >
Wrap
Text File
|
1989-07-09
|
14KB
|
605 lines
-- card: 3557 from stack: in
-- bmap block id: 7103
-- flags: 4000
-- background id: 2889
-- name: Options
----- HyperTalk script -----
on openCard
global expert
if hilite of button "expert" is true then
put true into expert
else
put false into expert
end if
end openCard
-- part 3 (button)
-- low flags: 00
-- high flags: 8005
-- rect: left=183 top=111 right=134 bottom=327
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Export References
----- HyperTalk script -----
on mouseUp
global exportOn, exportFile, wrtNumbers, exportNumber
set lockScreen to true
if hilite of button "Export References" is true then
set hilite of button "Export References" to false
put false into exportOn
push card
go to "Papers"
hide background button "Export"
pop card
close file exportFile
else
ask "Please enter the name of the export file:" with "References.TeX"
if it is empty then
exit mouseUp
else
put it into exportFile
end if
set hilite of button "Export References" to true
put true into exportOn
push card
go to card "format"
if hilite of card button "Number List?" is true then
put true into wrtNumbers
else
put false into wrtNumbers
end if
pop card
push card
go to "Papers"
show background button "Export"
pop card
open file exportFile
put 1 into exportNumber
end if
end mouseUp
-- part 11 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=268 top=26 right=47 bottom=340
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Abstracts
----- HyperTalk script -----
on mouseUp
go to first card of "Abstracts"
end mouseUp
-- part 12 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=345 top=26 right=47 bottom=421
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Key Words
----- HyperTalk script -----
on mouseUp
go to first card of "Key Words"
end mouseUp
-- part 13 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=425 top=19 right=55 bottom=464
-- title width / last selected line: 0
-- icon id / first selected line: 21060 / 21060
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Help
----- HyperTalk script -----
on mouseUp
global expert
set the lockScreen to true
push card
go to card "Options-Help" of "Reference Frame"
if expert is not true then show card field "Options-Help"
end mouseUp
-- part 16 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=207 top=26 right=47 bottom=263
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Papers
----- HyperTalk script -----
on mouseUp
go to first card of "Papers"
end mouseUp
-- part 14 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=456 top=10 right=63 bottom=490
-- title width / last selected line: 0
-- icon id / first selected line: 1014 / 1014
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Prev
----- HyperTalk script -----
on mouseUp
go to card "Information"
end mouseUp
-- part 15 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=478 top=10 right=63 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 1013 / 1013
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next
----- HyperTalk script -----
on mouseUp
visual effect iris close slow
go to card "Title"
end mouseUp
-- part 17 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=65 top=207 right=228 bottom=190
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Abstract ID's
----- HyperTalk script -----
on mouseUp
set lockScreen to true
ask "Please enter the name of the export file:" with "Abstracts.text"
if it is empty then exit mouseUp
put it into exportFile
ask "Please enter search string:"
if it is empty then exit mouseUp
put it into exportString
push card
go to first card of stack "Abstracts"
find exportString
if the result is not empty then
close file exportFile
exit mouseUp
end if
--
-- got something to write
--
set cursor to 4
open file exportFile
put field "ID" into firstCard
write "The following is a list of paper ID's " to file exportFile
write "which contain the string, " & exportString to file exportFile
write return & return to file exportFile
write field "ID" & return to file exportFile
repeat
find exportString
if field "ID" is firstCard then
--
-- normal exit
--
close file exportFile
pop card
exit mouseUp
end if
write field "ID" & return to file exportFile
end repeat
end mouseUp
-- part 18 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=318 top=207 right=228 bottom=443
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Key Word ID's
----- HyperTalk script -----
on mouseUp
set lockScreen to true
ask "Please enter the name of the export file:" with "KeyWords.text"
if it is empty then exit mouseUp
put it into exportFile
ask "Please enter key word:"
if it is empty then exit mouseUp
put it into exportKey
push card
go to first card of stack "Key Words"
find exportKey
if the result is not empty then
close file exportFile
exit mouseUp
end if
--
-- got something to write
--
set cursor to 4
open file exportFile
put field "ID" into firstCard
write "The following is a list of paper ID's " to file exportFile
write "which contain the key word, " & exportKey to file exportFile
write return & return to file exportFile
write field "ID" & return to file exportFile
repeat
find exportKey
if field "ID" is firstCard then
--
-- normal exit
--
close file exportFile
pop card
exit mouseUp
end if
write field "ID" & return to file exportFile
end repeat
end mouseUp
-- part 19 (button)
-- low flags: 00
-- high flags: 8005
-- rect: left=222 top=296 right=318 bottom=366
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Expert
----- HyperTalk script -----
on mouseUp
global expert
if hilite of button "Expert" is true then
set hilite of button "Expert" to false
put false into expert
exit mouseUp
else
set hilite of button "Expert" to true
put true into expert
end if
end mouseUp
-- part 20 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=21 top=111 right=134 bottom=138
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Format Output
----- HyperTalk script -----
on mouseUp
go to card "format"
end mouseUp
-- part 21 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=372 top=111 right=134 bottom=489
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Import-Export
----- HyperTalk script -----
on mouseUp
global exportFile, cardID, text
set lockScreen to true
ask "Please enter the name of the import file:" with "KeyWords.Input"
if it is empty then exit mouseUp
put it into importFile
open file importFile
-- check to see if importFile is empty --
read from file importFile until return
if it is empty then
answer "Sorry, file" && importFile && "is empty" with "OK"
close file importFile
exit mouseUp
end if
put it into cardID
ask "Please enter the name of the export file:" with "References.TeX"
if it is empty then
close importFile
exit mouseUp
end if
put it into exportFile
open file exportFile
push card
-- make sure that globals are defined --
set the cursor to 4
go to card "format"
pop card
push card
go to first card of stack "Papers"
put "1" into n
repeat
if the charToNum of last char in cardID < 32 then -- delete return
delete last char in cardID
end if
find cardID in field "ID"
if the result is not empty then
answer cardID && "was not found" with "Continue"
else
put output(n) into it
put n + 1 into n
end if
read from file importFile until return
if it is empty then
close file importFile
close file exportFile
pop card
exit mouseUp
end if
put it into cardID
end repeat
end mouseUp
--
-- output() writes this current record to file exportFile
--
function output number
global prefix, wrtNumbers, numberAffix, howMany, order, affix , nBlankL, exportFile
put prefix into string
if wrtNumbers is true then
put string & number & numberAffix into string
end if
--
-- check to see if this is a special case
--
if background field "Special Case" is not empty then
put string & background field "Special Case" into string
else -- build a normal reference --
repeat with i = 1 to howMany
if item i of order is "authors" then
put string & buildAuthors(field "authors") & line i of affix into string
else
put string & field item i of order & line i of affix into string
end if
end repeat
end if
write wrap(string) to file exportFile
repeat with i = 1 to nBlankL + 1
write return to file exportFile
end repeat
end output
--
-- buildAuthors() builds author list in correct format
--
function buildAuthors authors
global authorOrder, authorsAffix
put authorOrder into order
put authorsAffix into affix
put number of items in authors into numAuthors
put item 1 of authors into name
put firstName(name) into firstN
if char 1 of firstN is " " then delete char 1 of firstN
put lastName(name) into lastN
if char 1 of order is "f" then
put firstN & line 1 of affix & lastN into outStr
else
put lastN & line 1 of affix & firstN into outStr
end if
delete char 1 to 2 of order
delete line 1 of affix
repeat with n = 2 to numAuthors - 1
put outStr & line 1 of affix into outStr
put item n of authors into name
put firstName(name) into firstN
if char 1 of firstN is " " then delete char 1 of firstN
put lastName(name) into lastN
if char 1 of order is "f" then
put outStr & firstN & line 2 of affix & lastN into outStr
else
put outStr & lastN & line 2 of affix & firstN into outStr
end if
end repeat
if numAuthors < 2 then return outStr
delete char 1 to 2 of order
delete line 1 to 2 of affix
put outStr & line 1 of affix into outStr
put item numAuthors of authors into name
put firstName(name) into firstN
if char 1 of firstN is " " then delete char 1 of firstN
put lastName(name) into lastN
if char 1 of order is "f" then
put outStr & firstN & line 2 of affix & lastN into outStr
else
put outStr & lastN & line 2 of affix & firstN into outStr
end if
return outStr
end buildAuthors
--
-- firstName() returns first name from string name
--
function firstName name
put offset(last word of name,name) - 1 into numOfChars
if char numOfChars of name is " " then
put numOfChars - 1 into numOfChars
end if
return char 1 to numOfChars of name
end firstName
--
-- lastName() returns last name from string name
--
function lastName name
put last word of name into temp
if char 1 of temp is quote then
delete char 1 of temp
repeat with i = 1 to number of chars in temp
if char i of temp is quote then delete char i of temp
end repeat
end if
return temp
end lastName
--
-- wrap() breaks string into lines of at most 80 characters
--
function wrap string
put number of chars in string into nChars
put "80" into start
put "1" into stop
repeat
if start > nChars then exit repeat
put start into i
repeat while i > stop
if char i of string is space then
put return into char i of string
put i + 1 into stop
put 79 + stop into start
exit repeat
end if
put i - 1 into i
end repeat
if i is stop then
repeat with i = start to nChars
if char i of string is space then
put return into char i of string
put i + 1 into stop
put 79 + stop into start
exit repeat
end if
end repeat
end if
end repeat
return string
end wrap
-- part 22 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=318 top=207 right=228 bottom=443
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Key Word ID's
----- HyperTalk script -----
on mouseUp
set lockScreen to true
ask "Please enter the name of the export file:" with "KeyWords.text"
if it is empty then exit mouseUp
put it into exportFile
ask "Please enter key word:"
if it is empty then exit mouseUp
put it into exportKey
push card
go to first card of stack "Key Words"
find exportKey
if the result is not empty then
close file exportFile
exit mouseUp
end if
--
-- got something to write
--
set cursor to 4
open file exportFile
put field "ID" into firstCard
write "The following is a list of paper ID's " to file exportFile
write "which contain the key word, " & exportKey to file exportFile
write return & return to file exportFile
write field "ID" & return to file exportFile
repeat
find exportKey
if field "ID" is firstCard then
--
-- normal exit
--
close file exportFile
pop card
exit mouseUp
end if
write field "ID" & return to file exportFile
end repeat
end mouseUp